using SqlSugar;
using System;
using B.S.XZYData.Domain.BaseEntities;

namespace B.S.XZYData.Domain.ZSHH
{
    /// <summary>
    /// 任务表
    /// </summary>
    [SugarTable("task")]
    public class Task : BaseModel
    {
        /// <summary>
        /// 工序ID
        /// </summary>
        [SugarColumn(IsNullable = false)]
        public long ProcessId { get; set; }

        /// <summary>
        /// 工序编号
        /// </summary>
        [SugarColumn(Length = 50, IsNullable = false)]
        public string ProcessNumber { get; set; }

        /// <summary>
        /// 工序名称
        /// </summary>
        [SugarColumn(Length = 100, IsNullable = false)]
        public string ProcessName { get; set; }

        /// <summary>
        /// 报工权限
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public string ReportingPermissions { get; set; }

        /// <summary>
        /// 报工数配比
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public int? ReportingRatio { get; set; }

        /// <summary>
        /// 不良品项列表
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public string DefectiveItemList { get; set; }

        /// <summary>
        /// 分配列表
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public string AllocationList { get; set; }

        /// <summary>
        /// 计划开始时间
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public DateTime? PlannedStartTime { get; set; }

        /// <summary>
        /// 计划结束时间
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public DateTime? PlannedEndTime { get; set; }

        /// <summary>
        /// 计划数
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public int? PlannedQuantity { get; set; }

        /// <summary>
        /// 良品数
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public int? GoodQuantity { get; set; } = 0;

        /// <summary>
        /// 不良品数
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public int? DefectiveQuantity { get; set; } = 0;

        /// <summary>
        /// 实际开始时间
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public DateTime? ActualStartTime { get; set; }

        /// <summary>
        /// 实际结束时间
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public DateTime? ActualEndTime { get; set; }

        /// <summary>
        /// 导航属性 - 工序
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public Process Process { get; set; }
    }
} 